Skip to content

render: make set_framebuffer/get_framebuffer protected - #205

Merged
igagis merged 1 commit into
cppfw:mainfrom
igagis-bot:protected-fb-accessors
Nov 30, 2026
Merged

igagis merged 1 commit into
cppfw:mainfrom
igagis-bot:protected-fb-accessors

Conversation

@igagis-bot

Copy link
Copy Markdown
Contributor

Summary

The base rendering context already tracks the current framebuffer (cur_fb) via set_framebuffer()/get_framebuffer() — both were private:.

Renderers that convert scissor/viewport rects between the framework's top-left origin convention and their native bottom-left origin (OpenGL, OpenGL ES) need to read the current framebuffer's height. Two options:

  1. keep a duplicate renderer-side current_fb member (what the OpenGL/OpenGLES renderers had done), or
  2. make the base-class accessors protected: so subclasses read get_framebuffer().

This PR does (2). frame_buffer::apply() is a friend and unaffected.

Notes

  • Windows builds mangle access levels into the symbol name, so a rebuild of the ruis target after this change is required (stale objects fail to link).

The current framebuffer is tracked by the base class (cur_fb); renderers
that need the current framebuffer height (e.g. to convert scissor/viewport
rects to their native bottom-left origin convention) now read it through
get_framebuffer() instead of keeping their own duplicate member.
@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.55%. Comparing base (f7304df) to head (a288100).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #205   +/-   ##
=======================================
  Coverage   28.55%   28.55%           
=======================================
  Files         239      239           
  Lines        8945     8945           
  Branches     2785     2785           
=======================================
  Hits         2554     2554           
  Misses       6057     6057           
  Partials      334      334           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@igagis
igagis merged commit fbd7703 into cppfw:main Nov 30, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants